package com.ye.zcswzlms.mapper;

import com.ye.zcswzlms.entity.Permission;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;
import org.springframework.stereotype.Repository;

import java.util.List;

/**
 * <p>
 *  Mapper 接口
 * </p>
 *
 * @author 叶德辉
 * @since 2020-12-20
 */
@Mapper
@Repository
public interface PermissionMapper extends BaseMapper<Permission> {
    @Select("select p.pname,p.url " +
            "from tb_ur ur JOIN tb_rr rr on ur.tb_ur_role=rr.tb_rr_role " +
            "JOIN permission p on rr.tb_rr_right=p.pid" +
            " WHERE ur.tb_ur_user=#{stuNo}")
    List<Permission> queryPermission(@Param("stuNo")String stuNo);
}
